#include <opencv2\opencv.hpp>


class LabelEquivalenceSeg{
public:
	LabelEquivalenceSeg(int width, int height);
	~LabelEquivalenceSeg();

	void labelImage(bool* in);
	void viewSegmentResult();
	void copyData(bool* boundary, int* label);

	int* getLabelMap() const;
	bool* getBoundaryMap() const;


private:
	void initialize(bool* in);
	void scan();
	void analysis();
	void postProcess();
			

	int width;
	int height;
	int* img;
	int* label;
	int* ref;
	int* counter;

	
	bool* boundary_device;
	bool* boundary_host;

	cv::Mat_<cv::Vec3b> show;
	unsigned char** color_pool;
};